define a data structure:

  Student={person,{name,{first,yakkety},{last,yak}},{footsize,1}}.

access a member of data struct (by pattern matching, cool!!!):

  {_,{_,{_,HisName},_},_} = Student.qon

printing yakkety:

  io:fwrite("his name is: ~w~n", [HisName]).

define a list:

  Fruits = [{apples,10},{pears,6},{prunes,3}].

append something to a list:

  Fruits1 = [{oranges,4},{lemons,1}  Fruits].

get the head of the list (by pattern matching, cool!!!):

  [ListHeadFruits2] = Fruits1.

simple function:

  incr(Num) -> Num + 1.

recursive function:

  fac(0) -> 1;
  fac(Num) when Nun > 0 -> N * fac(Num-1).

infinite loop receiving messages (by pattern matching, cool!!!) and sending responses back (by the !operator):

  loop() ->
      receive
          {From, {request, Param1, Param2}} ->
              From ! {self(), Param1 + Param2},
              loop();
       end.

a foreach loop (note the lambda function definition between fun and end!):

  extract2ndElements(List) ->
      lists:map(fun({_,Second}) -> Second end, List).